<!DOCTYPE html>
<html>

<head>

    {include file="Public/header"}
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="__STATIC__/layout/css/plugins/webuploader/webuploader.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/layout/css/demo/webuploader-demo.css">
        <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <style>
        .radio-inline input[type=radio] {
            margin-top: 0px
        }
        .bqName{padding: 2px 4px;border-radius: 6px;background: #f66;cursor: pointer;}
    </style>

</head>

<body class="white-bg" style="color:#333;padding:3px;">
<div class="white-bg setRemindPeopleK" style="margin:10px">
    <form action="" class="form-inline" id="add" method="post">
        <table class="table table-bordered">
            <tr>
                <td class="text-right"><label for="" style="min-width: 160px;width: 160px">收货地址1 <span class="colorRed">*</span>:</label>
                </td>
                <td><input name="lgs_rcv_addr" value="{$data.lgs_rcv_addr}" type="text" class="form-control" style="width: 200px;min-width: 200px"></td>
                <td class="text-right"><label for="" style="min-width: 160px;width: 160px">收货人1 <span class="colorRed">*</span>:</label></td>
                <td><input name="lgs_rcv_one" value="{$data.lgs_rcv_one}" type="text" class="form-control"></td>
                <td class="text-right"><label for="" style="min-width: 160px;width: 160px">联系电话1 <span class="colorRed">*</span>:</label>
                </td>
                <td><input name="lgs_rcv_phone"value="{$data.lgs_rcv_phone}" type="text" class="form-control"></td>
            </tr>
            <tr>
                <td class="text-right"><label for="" style="min-width: 160px;width: 160px">收货地址2:</label></td>
                <td><input name="lgs_rcv_addr2" value="{$data.lgs_rcv_addr2}" type="text" class="form-control" name="" style="width: 200px;min-width: 200px"></td>
                <td class="text-right"><label for="" style="min-width: 160px;width: 160px">收货人2:</label></td>
                <td><input name="lgs_rcv_one2" value="{$data.lgs_rcv_one2}" type="text" class="form-control"></td>
                <td class="text-right"><label for="" style="min-width: 160px;width: 160px">联系电话2:</label></td>
                <td><input name="lgs_rcv_phone2" value="{$data.lgs_rcv_phone2}" type="text" class="form-control"></td>
            </tr>
            <tr>
                <td class="text-right"><label for="" style="min-width: 160px;width: 160px">收货地址3:</label></td>
                <td><input name="lgs_rcv_addr3" value="{$data.lgs_rcv_addr3}" type="text" class="form-control" style="width: 200px;min-width: 200px"></td>
                <td class="text-right"><label for="" style="min-width: 160px;width: 160px">收货人3:</label></td>
                <td><input name="lgs_rcv_one3" value="{$data.lgs_rcv_one3}" type="text" class="form-control"></td>
                <td class="text-right"><label for="" style="min-width: 160px;width: 160px">联系电话3:</label></td>
                <td><input name="lgs_rcv_phone3" value="{$data.lgs_rcv_phone3}" type="text" class="form-control"></td>
            </tr>
        </table>
        <div class="col-md-12 text-center" style="padding: 10px 0">
            <button class="btn-success btn" id="tijiao">确认并提交</button>
            <button class="btn-warning btn" id="cancelBack">返回</button>
        </div>

    </form>
</div>

<!-- 全局js -->
{include file="Public/footer"}
<script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>

<script>
    var cancelBack = document.getElementById('cancelBack')
    cancelBack.onclick = function () {
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
    }

    //提交
    $('#tijiao').on('click',function () {
        var form =  $('#add')
        var serial = form.not($('input[name=stuff]')).serialize()

        var admin = []
        $('#renyuan .ren').each(function (idx,o) {
            admin.push($(o).data('id'))
        })
        var admin2 = ''
        if(admin)
            admin2 = admin.join(',')

        serial = serial+'&stuff='+admin2
        console.log(serial)
        $.ajax({
            'type':'post',
            'url':form.attr('action'),
            'data':serial,
            'dataType':'json',
            'success':function (data) {
                if(data.success){
                    swal({
                        title: data.msg,
                        type: "success"
                    },function(){
                        parent.layer.close(parent.layer.getFrameIndex(window.name))
                        });

                }else
                    swal({
                        title: data.msg,
                        type: "warning"
                    });
            }
        })
        return false
    })

</script>

</body>

</html>